home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Taifun / Taifun 099 (1989-05-15)(Ossowski, Stefan)(DE)(PD).zip / Taifun 099 (1989-05-15)(Ossowski, Stefan)(DE)(PD).adf / PCQ / Runtime / case.asm next >
Assembly Source File  |  1989-03-31  |  488b  |  28 lines

  1.  
  2.     SECTION    CASE
  3.  
  4. *    Case.asm (of PCQ Pascal runtime library)
  5. *    Copyright (c) 1989 Patrick Quaid
  6.  
  7. *    This routine moves handles the case jump table.  It expects
  8. *    the case expression to be in d0, and the address of the
  9. *    table in a0.  It also requires a properly built table-
  10. *    there is no provision for stopping, except for the default
  11. *    case.
  12.  
  13.     XDEF    _p%case
  14. _p%case
  15.  
  16. 1$    tst.l    (a0)
  17.     beq.s    2$
  18.     cmp.l    4(a0),d0
  19.     beq.s    3$
  20.     addq.l    #8,a0
  21.     bra    1$
  22. 2$    addq.l    #4,a0
  23. 3$    move.l    (a0),a0
  24.     jmp    (a0)
  25.  
  26.     END
  27.  
  28.